package cn.zjweu.service.impl;

import cn.zjweu.dao.CategoryDao;
import cn.zjweu.dao.impl.CategoryDaoImpl;
import cn.zjweu.domain.DishCategory;
import cn.zjweu.service.CategoryService;

import java.util.List;

public class CategoryServiceImpl implements CategoryService {

    private CategoryDao categoryDao = new CategoryDaoImpl();

    @Override
    public List<DishCategory> findCategory() {
        return categoryDao.findCategory();
    }

    @Override
    public DishCategory findCategoryById(int categoryId) {
        return categoryDao.findCategoryById(categoryId);
    }

    @Override
    public void editCategoryById(int categoryId, String categoryName) {
        categoryDao.editCategoryById(categoryId, categoryName);
    }

    @Override
    public boolean delCategoryById(int categoryId) {
        return categoryDao.delCategoryById(categoryId);
    }

    @Override
    public boolean addCategory(String categoryName) {
        return categoryDao.addCategory(categoryName);
    }
}
